1 module directx.d3d11on12; 2 /*------------------------------------------------------------------------------------- 3 * 4 * Copyright (c) Microsoft Corporation 5 * 6 *-------------------------------------------------------------------------------------*/ 7 8 version(Windows): 9 version(Direct3D_11): 10 version(Direct3D_12): 11 12 public import directx.d3d11; 13 public import directx.d3d12; 14 15 /////////////////////////////////////////////////////////////////////////// 16 // D3D11On12CreateDevice 17 // ------------------ 18 // 19 // pDevice 20 // Specifies a pre-existing D3D12 device to use for D3D11 interop. 21 // May not be NULL. 22 // Flags 23 // Any of those documented for D3D11CreateDeviceAndSwapChain. 24 // pFeatureLevels 25 // Array of any of the following: 26 // D3D_FEATURE_LEVEL_12_1 27 // D3D_FEATURE_LEVEL_12_0 28 // D3D_FEATURE_LEVEL_11_1 29 // D3D_FEATURE_LEVEL_11_0 30 // D3D_FEATURE_LEVEL_10_1 31 // D3D_FEATURE_LEVEL_10_0 32 // D3D_FEATURE_LEVEL_9_3 33 // D3D_FEATURE_LEVEL_9_2 34 // D3D_FEATURE_LEVEL_9_1 35 // The first feature level which is less than or equal to the 36 // D3D12 device's feature level will be used to perform D3D11 validation. 37 // Creation will fail if no acceptable feature levels are provided. 38 // Providing NULL will default to the D3D12 device's feature level. 39 // FeatureLevels 40 // Size of feature levels array. 41 // ppCommandQueues 42 // Array of unique queues for D3D11On12 to use. Valid queue types: 43 // 3D command queue. 44 // Flags must be compatible with device flags, and its NodeMask must 45 // be a subset of the NodeMask provided to this API. 46 // NumQueues 47 // Size of command queue array. 48 // NodeMask 49 // Which node of the D3D12 device to use. Only 1 bit may be set. 50 // ppDevice 51 // Pointer to returned interface. May be NULL. 52 // ppImmediateContext 53 // Pointer to returned interface. May be NULL. 54 // pChosenFeatureLevel 55 // Pointer to returned feature level. May be NULL. 56 // 57 // Return Values 58 // Any of those documented for 59 // D3D11CreateDevice 60 // 61 /////////////////////////////////////////////////////////////////////////// 62 63 __gshared PFN_D3D11ON12_CREATE_DEVICE D3D11On12CreateDevice; 64 65 extern(Windows) 66 alias PFN_D3D11ON12_CREATE_DEVICE = HRESULT function( 67 IUnknown pDevice, 68 UINT Flags, 69 const(D3D_FEATURE_LEVEL)* pFeatureLevels, 70 UINT FeatureLevels, 71 const(IUnknown)* ppCommandQueues, 72 UINT NumQueues, 73 UINT NodeMask, 74 ID3D11Device* ppDevice, 75 ID3D11DeviceContext* ppImmediateContext, 76 D3D_FEATURE_LEVEL* pChosenFeatureLevel); 77 78 struct D3D11_RESOURCE_FLAGS 79 { 80 UINT BindFlags; 81 UINT MiscFlags; 82 UINT CPUAccessFlags; 83 UINT StructureByteStride; 84 } 85 86 mixin(uuid!(ID3D11On12Device, "85611e73-70a9-490e-9614-a9e302777904")); 87 extern (C++) interface ID3D11On12Device : IUnknown { 88 HRESULT CreateWrappedResource( 89 IUnknown pResource12, 90 const(D3D11_RESOURCE_FLAGS)* pFlags11, 91 D3D12_RESOURCE_STATES InState, 92 D3D12_RESOURCE_STATES OutState, 93 REFIID riid, 94 void** ppResource11); 95 96 void ReleaseWrappedResources( 97 const(ID3D11Resource)* ppResources, 98 UINT NumResources); 99 100 void AcquireWrappedResources( 101 const(ID3D11Resource)* ppResources, 102 UINT NumResources); 103 }